import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
import iView from 'iview';
import 'iview/dist/styles/iview.css';
import VueRouter from 'vue-router';
import VueCookie from 'vue-cookie';
import {routes} from './routes';
import {store} from './store/store';
import moment from "moment";

Vue.use(VueAxios, axios)
Vue.use(iView);
Vue.use(VueRouter);
Vue.use(VueCookie);

Vue.prototype.$moment = moment;
Vue.filter('moment', function(value, formatString) {
  formatString = formatString || 'YYYY-MM-DD ';
  return moment(value).format(formatString)
})

if (!String.prototype.moment) {
  String.prototype.moment = function(formatString) {
      formatString = formatString || 'YYYY-MM-DD';
      return moment(this).format(formatString)
  };
}

const router=new VueRouter({
  routes,
  mode:'hash'
})

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})

